from likeshop_api_project.api.login_api import login_model
from likeshop_api_project.base.mybase import Tools


# 个人中心
class user_model(Tools):
    path = '/api/user/center'

    def user_action(self, hd):
        user_data = {
        }
        user = self.huihua.get(url=self.hosturl+self.path, params=user_data, headers=hd)
        return user.json()


if __name__ == '__main__':
    import requests

    s = requests.session()
    reg = login_model(huihua=s)
    msg = reg.login_action(account="13356786546", password="rr98765", client=2)
    # print(msg)
    get_token = msg["data"]["token"]
    # print(get_token)
    hd = {"token": get_token}

    user = user_model(huihua=s)
    msg = user.user_action(hd=hd)
    print(msg)
